
#include <array>
#include <cassert>
#include <iostream>
using namespace std;

void print(int *p[3], const array<int, 3> &dims) {
  for (int i = 0; i < 3; ++i) {
    for (int j = 0; j < dims[i]; ++j) {
      cout << p[i][j] << "  ";
    }
    cout << "\n";
  }
}

void print(int **p, int m, int n) {
  for (int i = 0; i < m; ++i) {
    for (int j = 0; j < n; ++j) {
      cout << p[m][n] << "  ";
    }
    cout << "\n";
  }
}

int main() {
  int *p[3];
  p[0] = new int[2]{0, 1};
  p[1] = new int[3]{2, 3, 4};
  p[2] = new int[4]{5, 6, 7, 8};

  array<int, 3> dims{2, 3, 4};
  print(p, dims);

  int val[2][2]{{2, 3}, {4, 5}};
  // print(val, 2, 2);
  return 0;
}